package com.scs.application.modules.dept.controller;

import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.modules.dept.entity.BudgetMatr;
import com.scs.application.modules.dept.service.BudgetMatrService;
import com.scs.application.modules.sys.model.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 科室预算明细-耗材表 前端控制器
 * </p>
 */
@RestController
@RequestMapping("/dept/budget_matr")
public class BudgetMatrController extends CrudController<BudgetMatrService, BudgetMatr>{

    /**
    * @Description：批量保存限制耗材
    */
    @PostMapping("/saveBatchItemMatr")
    public RestResult saveBatchItemMatr(@Valid @RequestBody List<BudgetMatr> entityList) {
        service.saveBatchItemMatr(entityList);
        return RestResult.ok("批量添加成功",  entityList);
    }
}
